home *** CD-ROM | disk | FTP | other *** search
- Path: gail.ripco.com!mambuhl
- From: mambuhl@ripco.com (Martin Ambuhl)
- Newsgroups: comp.lang.c
- Subject: Re: simple code, argc, ar
- Date: 3 Feb 1996 05:27:22 GMT
- Organization: Ripco Communications, Inc.
- Message-ID: <4eurnq$8oc@gail.ripco.com>
- NNTP-Posting-Host: golden.ripco.com
-
- otisg@panther.middlebury.edu (Otis Gospodnetic)
- in <11f7cc$17261a.3b3@daprez> asks:
-
- [snip]
- >Problem - I am doing something wrong and I almost always end up calling
- >Usage() even if I use the program correctly.
-
- [snip]
- > if (!strcmp(argv[1],"-d") || !strcmp(argv[1],"-e")) {
- > Usage();
- Suppose arv[1] is "-d", then this is
- if (1 /* || !strcmp(argv[1],"-e") */) ...
- Suppose argv[2] is "-e", then it is
- if (0 || 1) ...
-
- Only when argv[1] is neither "-d" nor "-e" is Usage() called.
-
- Try
- > if (strcmp(argv[1],"-d") && strcmp(argv[1],"-e")) {
-
- --
- * Martin Ambuhl net: mambuhl@ripco.com
- * Chicago, IL (USA)
-